package com.twp.auth.domain.authority.user;

import lombok.Data;

import javax.persistence.*;
import java.util.Date;

@Data
@Entity
@Table(
        name = "twp_user_detail",
        indexes = {
                @Index(name = "phoneNumber_index",columnList = "phoneNumber"),
        },
        uniqueConstraints ={
                @UniqueConstraint(
                        columnNames={"phoneNumber"}
                )
        }
)
public class UserDetail {

    /**
     * 编号
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;

    /**
     * 更新时间
     */
    @Column(name = "updateTime")
    private Date updateTime;

    /**
     * 创建时间
     */
    @Column(name = "createTime")
    private Date createTime;
    /*
    昵称
     */
    private String userAlias;

    /*
    手机
     */
    private String phoneNumber;

    /*
    email
     */
    private String email;


    @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "userId")
    private ManageUser manageUser;
}
